package interview.huawei.tjt.training.huaweijishi;

import java.util.Scanner;

public class CPUGPU {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int maxExec = scanner.nextInt();
        int len = scanner.nextInt();
        int[] taskArr = new int[len];
        for (int i =0; i < len; i ++) {
            taskArr[i] = scanner.nextInt();
        }

        int seconds = 0;
        int lastLeft = 0;
        for (int i = 0; i < len; i ++) {
            taskArr[i] += lastLeft;
            if (taskArr[i] > maxExec) {
                lastLeft = taskArr[i] - maxExec;
            } else {
                lastLeft = 0;
            }
            seconds ++;
        }
        while (lastLeft > 0) {
            lastLeft -= maxExec;
            seconds ++;
        }
        System.out.println(seconds);
    }

}
